#include <stdio.h>
#include "gui_menu.h"
#include "gui_menu_info.h"
#include "gui_menu_func.h"
#include "sys_stdio.h"

static GUI_OBJECT(driver_info);
    static GUI_OBJECT(license_number);

static GUI_OBJECT(overtime_driver_record);
    static GUI_OBJECT(driver_record);

static GUI_OBJECT(security_settings);

static GUI_OBJECT(system_reboot);

static GUI_OBJECT(driving_record_export);

static int drive_record_content(struct lcd_display_tools *tools)
{
    int ret =0;
    if(tools->display==NULL)
    {
        goto out;
    }
    tools->display(0,0,"行车记录导出",0);
    sj_kprintf("行车记录导出 \r\n");

    out:
    return ret;
}

static int system_reboot_content(struct lcd_display_tools *tools)
{
    int ret =0;
    if(tools->display==NULL)
    {
        goto out;
    }
    tools->display(0,0,"设备重启",0);
    sj_kprintf("设备重启 \r\n");

    out:
    return ret;
}

static int security_content(struct lcd_display_tools *tools)
{
    int ret =0;
    if(tools->display==NULL)
    {
        goto out;
    }
    tools->display(0,0,"安全设定",0);
    sj_kprintf("安全设定 \r\n");

    out:
    return ret;
}

static int overtime_content(struct lcd_display_tools *tools)
{
    int ret =0;
    if(tools->display==NULL)
    {
        goto out;
    }
    tools->display(0,0,"超时驾驶记录:无",0);
    sj_kprintf("超时驾驶记录 \r\n");

    out:
    return ret;
}

static int driver_info_content(struct lcd_display_tools *tools)
{
    int ret =0;
    if(tools->display==NULL)
    {
        goto out;
    }
    tools->display(0,0,"司机个人信息:slj",0);
    sj_kprintf("司机个人信息 \r\n");

    out:
    return ret;
}

void gui_menu_add_child(struct gui_object *menu)
{
    gui_menu_add_function(menu);//add system setting

    gui_object_init(&driving_record_export,"行车记录导出");
    gui_object_add_child(menu,&driving_record_export);
    gui_object_add_content(&driving_record_export,drive_record_content);

    gui_object_init(&system_reboot,"主机设备重启");
    gui_object_add_child(menu,&system_reboot);
    gui_object_add_content(&system_reboot,system_reboot_content);

    gui_object_init(&security_settings,"安全设定");
    gui_object_add_child(menu,&security_settings);
    gui_object_add_content(&security_settings,security_content);

    gui_menu_add_information(menu);//add information serach

    gui_object_init(&overtime_driver_record,"超时驾驶记录");
    gui_object_add_child(menu,&overtime_driver_record);
    gui_object_add_content(&overtime_driver_record,overtime_content);


    gui_object_init(&driver_info,"司机个人信息");
    gui_object_add_child(menu,&driver_info);
    gui_object_add_content(&driver_info,driver_info_content);

}
